<template>
    <div>
        首页
        <br>
        我的token是：{{ token }}
        <br>
        我的名字是：{{ userInfo.name }}
        <component-one :msg="msg" @zhaosn="tellMe"/>
        父组件内容：{{ msg }}
        <component-two/>
    </div>
</template>

<script>
    // import axios from 'axios';
    import ComponentOne from "@/components/ComponentOne";
    import ComponentTwo from "@/components/ComponentTwo";

    export default {
        name: "",
        components: {
            ComponentOne,
            ComponentTwo
        },
        data() {
            return {
                msg: '我是唐运远',
                userInfo: {},
                token: localStorage.getItem("TOKEN"),
            }
        },
        created() {
            // axios.get("http://localhost:8090/api/user/mine/info", {headers: {TOKEN: this.token}}).then(res => {
            //     this.userInfo = res.data.data;
            // })
        },
        methods: {
            tellMe(val) {
                this.msg = val;
            }
        }
    }
</script>

<style scoped>

</style>